package com.twu.biblioteca.controller;

import com.twu.biblioteca.BibliotecaApp;
import com.twu.biblioteca.model.Book;
import com.twu.biblioteca.model.User;
import com.twu.biblioteca.view.BookListView;

import java.util.Scanner;

/**
 * Created by akutschm on 07/05/2014.
 */
public class UserInformationController extends AbstractController implements Controller {

    public UserInformationController(Scanner reader, BibliotecaApp app) {
        super(reader, app);

        User user = app.getUser();

        println("Your information:");
        println("Name: " + user.getName());
        println("Email: " + user.getEmail());
        println("Phone: " + user.getPhone());

        println("");
        println("Choose one of the following options:\n[Back] Go back to the main menu\n[Quit] quit.");
        println("");

        handleUserInput();
    }

    @Override
    public void doHandleUserInput(String input) {
        switch (input) {
            case "Back":
                goTo(Place.MAIN_MENU);
                break;
            case "Quit":
                handleUserInput = false;
                println("Have a nice day!");
                break;
            default:
                println("Select a valid option!\n");
        }
    }
}
